package day24;

import java.io.*;

//缓冲流：实现文件复制
public class Demo2 {
    public static void main(String[] args) {
        try {
            FileInputStream fis=new FileInputStream("C:\\Users\\梅穿内裤\\Desktop\\IOTest\\aa\\kejian.mp4");
            FileOutputStream fos=new FileOutputStream("C:\\Users\\梅穿内裤\\Desktop\\IOTest\\aa\\dd\\my.mp4");
            BufferedInputStream bis=new BufferedInputStream(fis);
            BufferedOutputStream bos=new BufferedOutputStream(fos);
            byte bs[]=new byte[1024];
            int len=0;
            long start=System.currentTimeMillis();
            while ((len=bis.read(bs))!=-1){
                bos.write(bs,0,len);
            }
            long end=System.currentTimeMillis();
            System.out.println("消耗的时间为:"+(end-start)+"ms");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
